# -*- coding: utf-8 -*-
"""
Created on Sat Nov 16 09:25:19 2024

@author: Michael
"""

import pandas
pandas.options.plotting.backend = "plotly"
import plotly.graph_objects as go
import plotly.io as pio
# from pathvalidate import is_valid_filename

import sys
sys.path.append(r"C:\Michael\Albany LAIO Lab and Research Projects\Topics Coding Scheme\Presidential Scheme and Topic Data")
sys.path.append(r"C:\Michael\Albany LAIO Lab and Research Projects\Python Utilities")

Abbas_DF = pandas.read_excel(r"C:\Michael\Albany LAIO Lab and Research Projects\Spontaneous vs Prepared\Abbas.xlsx")


#create go Figure
fig = go.Figure()

    
# Add traces
fig.add_trace(go.Bar(x=Abbas_DF['Variable'],
                     y=Abbas_DF['Height'],
                     base=Abbas_DF['Base'],
                     marker_color='rgba(0,0,0,0)',
                     marker=dict(line=dict(color='blue', width=1)),
                     width=[0.2]*len(Abbas_DF['Height']),
                    name='+/- 1 sd from TALID mean',
                    ))

fig.add_trace(go.Scatter(x=Abbas_DF['Variable'],
                          y=Abbas_DF['Prepared'],
                          mode='markers',
                          name='Prepared',
                          ))

fig.add_trace(go.Scatter(x=Abbas_DF['Variable'],
                          y=Abbas_DF['Spontaneous'],
                          mode='markers',
                          name='Spontaneous',
                          ))

fig.update_layout(xaxis_type='category')
#fig.update_yaxes(range=[0, 1])
fig.show()